#include <fs/dirent.h>
#include <fflags.h>

void dirent_assign(dirent_t *dir, const char *name, unsigned int len, unsigned int type) {
    dir->d_type = type;
    dir->d_nlen = len;
    strncpy(dir->d_name, name, DIRENT_NAME_MAX_LEN);
}

unsigned int fs_get_dtype(unsigned int inode_type) {
    switch (inode_type) {
        case FS_DIR:
            return DT_DIR;
        case FS_FILE:
            return DT_FILE;
        case FS_LINK:
            return DT_SYMLINK;
        default:
            return DT_PIPE;
    }
}